package com.atguigu.my.chapter03

/**
 *
 * @description: 隐式类案例
 * @time: 2020-05-25 16:05
 * @author: baojinlong 
 **/
object ImplicitClassDemo {
  def main(args: Array[String]): Unit = {
    //val list = List(1,2)
    val mySQl = new MySQl
    mySQl.syOk()
    val str: String = mySQl.addSuffix()
    println(str)
  }

  implicit class DB1(mysql: MySQl) {
    def addSuffix(): String = {
      mysql + " = scala"
    }
  }

}

class MySQl {
  def syOk(): Unit = {
    println("mysql sayOk()...")
  }
}
